# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Contributor: Ionut Biru <ibiru@archlinux.org>
# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>

pkgname=libgee
pkgver=0.20.6
pkgrel=1
pkgdesc="A collection library providing GObject-based interfaces and classes for commonly used data structures"
url="https://gitlab.gnome.org/GNOME/libgee"
license=(LGPL2.1)
arch=(x86_64)
depends=(glib2)
makedepends=(gobject-introspection vala autoconf-archive git)
options=(debug)
_commit=7d332f82c750ba72a6c625f38e4bfd44b786a926  # tags/0.20.6^0
source=("git+https://gitlab.gnome.org/GNOME/libgee.git#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd libgee
  git describe --tags | sed 's/[^-]*-g/r&/;s/-/+/g'
}

prepare() {
  cd libgee
  NOCONFIGURE=1 ./autogen.sh
}

build() {
  cd libgee
  ./configure --prefix=/usr --disable-static
  make
}

check() {
  cd libgee
  # generates a bazillion traps - make sure systemd's core_pattern
  # is deactivated, or you'll DoS the journal and the system
  #make check
}

package() {
  depends+=(libg{lib,object,io}-2.0.so)
  provides+=(libgee-0.8.so)

  cd libgee
  make DESTDIR="$pkgdir" install
}
